package infra

import "fmt"

const (
	// type(config or instance), platform, user_id, kind, guid, name
	DetailRepoKeyFormat  = `/repository/%v/%v/%v/%v/%v/%v`
	RuntimeRepoKeyFormat = `/runtime/%v/%v/%v/%v/%v/%v`

	ReportRepoKey     = `/report/`
	JaegerDagRepoKey  = `/dag/jaeger/`
	LinkerdDagRepoKey = `/dag/linkerd/`

	IndexRepoKeyFormat = `/index/%v`

	RootKey              = "/infra/"
	RootValueKey         = "/infra"
	InstanceRootValueKey = "/tree"
)

func BuildDetailRepoKey(typ string, platform string, userId string, kind string, guid string, name string) string {
	return fmt.Sprintf(DetailRepoKeyFormat, typ, platform, userId, kind, guid, name)
}

func BuildRuntimeRepoKey(typ string, platform string, userId string, kind string, guid string, name string) string {
	return fmt.Sprintf(RuntimeRepoKeyFormat, typ, platform, userId, kind, guid, name)
}
